package com.woniuxy.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;

@AllArgsConstructor
@NoArgsConstructor
@Data
@TableName("house")
public class House {
    @TableId(value = "id",type = IdType.AUTO)
    private Integer id;
    private Integer storey;
    private String numbers;
    private Integer status;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")//序列化时 日期为指定格式
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")//接收时间的格式必须是这个样子
    private LocalDateTime intoDate;
    private Integer buildingId;
    private String remarks;
    private Double area;
    @TableField(exist = false)
    private Building building;

}
